package com.sws.worktive.volley;

import android.content.Context;
import android.content.SharedPreferences;

public class ForceUpgradeDataPreference {
	private static final String FORCE_UPGRADE_SHARED_PREFERENCE = "force_upgrade_shared_preference";
	
	public static final String VERSION_CHECK_RESULT_KEY = "version_check_result";
	
	public static final String DONT_ASK_AGAIN = "dont_ask_again";
	
    private static SharedPreferences getPreferences(Context context) {
        return context.getSharedPreferences(FORCE_UPGRADE_SHARED_PREFERENCE, Context.MODE_PRIVATE);
    }
    
    public static String getVersionCheckResult(Context context){
    	return getPreferences(context).getString(VERSION_CHECK_RESULT_KEY, null);
    }
    
    public static boolean setVersionCheckResult(Context context, String value){
    	return getPreferences(context).edit().putString(VERSION_CHECK_RESULT_KEY, value).commit();
    }
    
    //set don't ask me again in sharedPreference
    public static boolean setDontAskAgain(Context context, boolean value){
    	return getPreferences(context).edit().putBoolean(DONT_ASK_AGAIN, value).commit();
    }
    
    //get don't ask me again from sharedPreference
    public static boolean getDontAskAgain(Context context){
    	return getPreferences(context).getBoolean(DONT_ASK_AGAIN, false);
    }

}
